/*Header file for matvec.c
This header file defines allocation functions for matrix and vector.
*/
#ifdef __cplusplus
extern "C" {
#endif

#include <stdlib.h>
#ifndef H_MATVEC
#define H_MATVEC

int *ivector(size_t n);
void free_ivector(int *a);

double *dvector(size_t n);
void free_dvector(double *a);

float *fvector(size_t n);
void free_fvector(float *a);

int **imatrix(size_t row, size_t column);
void free_imatrix(int **a);

double  **mydmatrix(size_t row, size_t column);
void  free_mydmatrix(double **a);

double *dvector_realloc(double *a, size_t n);
double **mydmatrix_realloc(double **a, size_t rows, size_t columns);

float **fmatrix(size_t row, size_t column);
void free_fmatrix(float **a);

double **initial_matrix(int m, int n);
double *initial_vector(int n);


/*Not to use this in new edition*/
typedef struct dvec {
double *vec;
int len;
} d_vector;

typedef struct dmat {
double **mat;
int x;
int y;
} d_matrix;

#endif /* H_MATVEC */

#ifdef __cplusplus
}
#endif
